package com.wxmit.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Description DataPermissionEnum
 * @Author huangxiong
 * @Date 2022/7/15 17:06
 * @Version V1.0
 */
@AllArgsConstructor
@Getter
public enum DataPermissionEnum {

    ALL("1"),
    CUSTOM("2"),
    DEPT("3"),
    DEPT_AND_CHILD("4"),
    SELF("5");

    private final String code;

    public static DataPermissionEnum getByCode(String code){
        for (DataPermissionEnum value : values()) {
            if(Objects.equals(code,value.code)){
                return value;
            }
        }
        return null;
    }

}
